//
//  YGFoodDetailBLL.m
//  yuanshangyiliao
//
//  Created by admin on 2021/4/30.
//

#import "YGFoodDetailBLL.h"
#import <MJExtension/MJExtension.h>

@implementation YGFoodDetailBLL
+ (void)requestFoodDetailWithID:(NSString *)foodId Success:(void (^)(YGFoodDetailModel * _Nonnull))success fail:(void (^)(NSError * _Nonnull))fail {
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    [dic setObject:foodId forKey:@"foodId"];
    [dic setObject:@"TOKEN_MEMBER-e0bf96792a434d7abff47160d384ace8" forKey:@"token"];

    [[CNHTTPManager shared] GET:YG_FOOD_DETAIL_URL parameters:dic success:^(id responeObj) {
        NSDictionary *data = [responeObj objectForKey:@"data"];
        YGFoodDetailModel *model =  [YGFoodDetailModel mj_objectWithKeyValues:data];
        if (success) {
            success(model);
        }
    } failure:^(NSError *error, NSString *errorDes) {
        if (fail) {
            fail(error);
        }
    }];
}
@end
